/**乐谱接口 */
import request from "@/utils/request";
// 获取乐谱列表接口
export function getMusicScoreList(limit, page) {
    return request({
        url: `/api/v1/musicScore/getMusicScoreList/${limit}/${page}`,
        method: "get",
    });
}
// 通过id获取乐谱接口
export function getMusicScoreById(id) {
    return request({
        url: `/api/v1/musicScore/readMusicScore/${id}`,
        method: "get",
    });
}
// 乐谱点赞接口
export function MusicScoreThumb(data) {
    return request({
        url: `/api/v1/musicScore/like`,
        method: "post",
        data,
    });
}
// 获取用户对该乐谱点赞状态接口
export function getMusicScoreThumbStatus(musicScore_id) {
    console.log("musicScore_id", musicScore_id);
    return request({
        url: `/api/v1/musicScore/like/status/${musicScore_id}`,
        method: "get",
    });
}
// 获取乐谱评论列表接口
export function getCommentList(musicScore_id, limit, page) {
    return request({
        url: `/api/v1/musicScore/getCommentList/${musicScore_id}/${limit}/${page}`,
        method: "get",
    });
}
// 乐谱评论点赞
export function CommentThumb(data) {
    return request({
        url: `/api/v1/comment/like`,
        method: "post",
        data,
    });
}
// 乐谱评论点赞状态获取
export function getCommentThumbStatus(comment_id) {
    return request({
        url: `/api/v1/comment/like/status/${comment_id}`,
        method: "get",
    });
}

// 刷新乐谱不改变浏览量
export function RefreshMusicScore(id) {
    return request({
        url: `/api/v1/musicScore/refreshMusicScore/${id}`,
        method: "get",
    });
}
// 为乐谱添加评论
export function addComment(data) {
    return request({
        url: `/api/v1/musicScore/addComment`,
        method: "post",
        data,
    });
}
// 通过乐谱id获取作者
export function getAuthorByMusicScoreId(musicScore_id) {
    return request({
        url: `/api/v1/musicScore/getAuthor/${musicScore_id}`,
        method: "get",
    });
}
// 通过作者id获取乐谱列表
export function getMusicScoreByAuthorId(user_id, limit, page) {
    return request({
        url: `/api/v1/musicScore/getMusicScoresByAuthor/${user_id}/${limit}/${page}`,
        method: "get",
    });
}
// 为评论添加回复评论
export function addReplyComment(data) {
    return request({
        url: `/api/v1/comment/addReply`,
        method: "post",
        data,
    });
}
// 发布乐谱
export function publishMusicScore(data) {
    return request({
        url: `/api/v1/musicScore/publishMusicScore`,
        method: "post",
        data,
    });
}
// 删除乐谱
export function deleteMusicScore(data) {
    console.log(data)
    return request({
        url: `/api/v1/musicScore/deleteMusicScore`,
        method: "delete",
        data,
    });
}
// 编辑乐谱
export function editMusicScore(data) {
    return request({
        url: `/api/v1/musicScore/alter`,
        method: "put",
        data,
    });
}
// 删除已上传的图片
export function removeUploadImage(data) {
    return request({
        url: `/api/v1/musicScore/alter`,
        method: "put",
        data,
    });
}
// 通过tagId获取乐谱
export function getMusicScoreByTagId(tagId, limit, page) {
    return request({
        url: `/api/v1/tag/getMusicScoresByTagId/${tagId}/${limit}/${page}`,
        method: "get",
    });
}
// 下载乐谱
export function downLoad(data) {
    return request({
        url: `/api/v1/musicScore/download`,
        method: "post",
        responseType: 'blob',
        data
    });
}
// 删除乐谱评论
export function deleteMusicScoreComment(data) {
    return request({
        url: `/api/v1/comment/deleteMusicScoreComment`,
        method: "delete",
        data,
    });
}
// 查看该乐谱用户的付费状态
export function ReviewUserMusicScorePaidStatus(user_id, music_score_id) {
    return request({
        url: `/api/v1/musicScore/paid/status/${user_id}/${music_score_id}`,
        method: "get",
    });
}
// 用户通过余额购买乐谱
export function BuyMusicScoreByCoin(data) {
    return request({
        url: `/api/v1/musicScore/buy`,
        method: "post",
        data
    });
}